<!DOCTYPE html>
<html lang="zh">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link href="../static/css/prism.css" rel="stylesheet" />
</head>

<body>
    <h2>length 属性</h2>
    <p>返回数组内成员的数量</p>
    <pre><code class="language-javascript">['sxt', 'baizhan', 'it'].length // 3</code></pre>

    <p>访问超出范围的元素将输出undefined</p>
    <pre><code class="language-javascript">var arr = [ 'sxt', 'baizhan', 'it' ];
console.log(arr[5])  // undefined</code></pre>

    <script src="../static/js/prism.min.js"></script>

    <script>
        console.log("练习开始");
        var arr = ['sxt', 'baizhan', 'it'];
        console.log(arr[5])  // undefined
    </script>
</body>

</html>